//
//  ConversationViewController.m
//  YHChat
//
//  Created by 银河 on 2019/2/17.
//  Copyright © 2019 yinhe. All rights reserved.
//

#import "ConversationViewController.h"
#import <ImSDK/ImSDK.h>
@interface ConversationViewController ()

@end

@implementation ConversationViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    
    self.navigationItem.title = @"会话列表";
    
    UIBarButtonItem *rightItem = [[UIBarButtonItem alloc] initWithTitle:@"发送" style:UIBarButtonItemStylePlain target:self action:@selector(testSend)];
    self.navigationItem.rightBarButtonItem = rightItem;
    
}

- (void)testSend{
    TIMConversation *conv = [[TIMManager sharedInstance]
                             getConversation:TIM_C2C
                             receiver:@"test01"];
    
    TIMMessage *msg = [[TIMMessage alloc] init];
    TIMTextElem *imText = [[TIMTextElem alloc] init];
    imText.text = @"测试测试";
    [msg addElem:imText];
    
    [conv sendMessage:msg succ:^{
        
    } fail:^(int code, NSString *msg) {
        
    }];
}

@end
